home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
machack
/
Hacks97
/
WarriorsProgress.sit
/
Warrior’s Progress
/
source code
/
Source
/
Libraries
/
Idle
/
Repeater.cp
< prev
next >
Wrap
Text File
|
1997-06-28
|
619b
|
41 lines
// Repeater.cp
#ifndef Repeater_h
#include "Repeater.h"
#endif
Repeater::Repeater( const Method& method, bool startEnabled )
: Enableable( startEnabled ),
repeat( this, &Repeater::Repeat ),
inProgress( false ),
toRepeat( method )
{
if ( startEnabled )
repeat.Schedule();
}
void Repeater::BeEnabled()
{
if ( !inProgress )
repeat.Schedule();
}
void Repeater::BeDisabled()
{
if ( !inProgress )
repeat.Cancel();
}
void Repeater::Repeat()
{
Assert( !inProgress );
Assert( Enabled() );
inProgress = true;
toRepeat();
inProgress = false;
if ( Enabled() )
repeat.Schedule();
}